using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using UnityEngine;
using FrameWork.HTN;
using Unity.VisualScripting;
using Random = UnityEngine.Random;

namespace NPC.Enemy
{
    // BOSS AI类
    // 播放动画
    // 移动
    // 战斗
    public class BossManager : SingletonMonoBehaviour<BossManager>
    {

        // 战斗状态
        public bool IsHurting { get; set; }                                              // 是否受伤
        public bool IsDeath { get; set; }

        public void Attack(float damage)
        {
            IsHurting = true;
            
            // 更新血量
            HTNWorld.UpdateState("BossHealth", Mathf.Max(0, HTNWorld.GetWorldState<float>("BossHealth") - damage));
            print("当前血量" + HTNWorld.GetWorldState<float>("BossHealth"));
            if(HTNWorld.GetWorldState<float>("BossHealth") <= 0f)
                IsDeath = true;
        }

        public void TakeDeath()
        {
            //
        }
    }
}